# 定义函数
def add (a, b):
    """"加上"""
    return a + b

def subtract(a, b):
    return a - b

def multiply(a, b):
    return a * b

def divide(a, b):
    return a / b

def divisible(a, b):
    return a // b

def sqrt(a, b):
    return a ** (1/b)

def surplus(a, b):
    return a % b

#交互界面
print("请选择您将进行的运算： ")
print("1,加上")
print("2,减去")
print("3,乘以")
print("4,除去")
print("5，整除")
print("6，开方")
print("7,取余")

choice = input("请输入您的选择(1,2,3,4，5,6,7): ")
num1 = int(input("输入第一个数字: "))
num2 = int(input("输入第二个数字: "))

if choice == '1':
    print(num1, "+", num2, "=", add(num1, num2))

elif choice == '2':
    print(num1, "-", num2, "=", subtract(num1, num2))

elif choice == '3':
    print(num1, "*", num2, "=", multiply(num1, num2))

elif choice == '4':
    print(num1, "/", num2, "=", divide(num1, num2))

elif choice == '5':
    print(num1, "//", num2, "=", divisible(num1, num2))

elif choice == '6':
    print(num1, "**", (1/num2), "=", sqrt(num1, num2))

elif choice == '7':
    print(num1, "%", num2, "=",  surplus(num1, num2))

else:
    print("非法输入")

